<?php
namespace PsiFramework\Classes\Util\Log;

import("Classes.Util.Log.LoggerManager");

use \PsiFramework\Classes\Util\Log\LoggerManager;

/**
 * PsiFramework
 * Php Simple Framework
 *
 * @author Rémi San
 * @version beta
 */

/**
 * The LoggerManager class is used to log things
 *
 * @package Util.Log
 */
class Logger
{

    protected /*LoggerManager*/  $_loggerManager ;
    protected /*string*/         $_className ;

    /**
     * Constructor
     */
    public function __construct(/*className*/ $className)
    {
        $this->_loggerManager = LoggerManager::getInstance();
        $this->_className = $className ;
    }

    /**
     * Adds a log entry
     *
     * @param string $level
     * @param string $message
     */
    protected function addLog(/*string*/ $level, /*string*/ $message)
    {
        $this->_loggerManager->addLog($this->_className, $level, $message);
    }

    /**
     * Adds an info entry
     *
     * @param string $message
     */
    public function info(/*string*/ $message)
    {
        $this->addLog("INFO", $message);
    }

    /**
     * Adds a debug entry
     *
     * @param string $message
     */
    public function debug(/*string*/ $message)
    {
        $this->addLog("DEBUG", $message);
    }

    /**
     * Adds an error entry
     *
     * @param string $message
     */
    public function error(/*string*/ $message)
    {
        $this->addLog("ERROR", $message);
    }
}
